Search Matching - Mailing list pgsql-sql

From lynch@lscorp.com (Richard Lynch)
Subject Search Matching
Date
Msg-id v02140b44b1737f06e6d5@[207.152.64.133]
Whole thread Raw
List pgsql-sql
Is there some easy way to:

1.  Match multiple fields with the same key

select * from table where * ~* 'key';

2.  Get a count of the number of matches:

EG:

table:
First     | Last
--------------------
John      | Doe
Jane      | Doe
John      | Johnson

I need a query that given 'John' and 'Doe' would return something like:

Score  | First   | Last
-----------------------
2      | John    | Doe
2      | John    | Johnson
1      | Jane    | Doe

I guess I want a search engine just like the big boys, but I don't want to
get too carried away with coding it up in PHP if there's some SQL that will
do it faster/better.  :-)

--
--
-- "TANSTAAFL" Rich lynch@lscorp.com



pgsql-sql by date:

Previous
From: Mario Filipe
Date:
Subject: ...
Next
From: "Roland B. Roberts"
Date:
Subject: subscribe